import request from '@/utils/request'

// 上传学生照片
export function uploadStudentPhotos(formData, onProgress) {
    return request({
        url: '/student/photo/upload',
        method: 'post',
        data: formData,
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        onUploadProgress: progressEvent => {
            const percent = progressEvent.loaded / progressEvent.total
            onProgress(percent)
        },
        timeout: 30000  // 上传超时设置为30秒
    })
}

// 匹配学生照片
export function matchStudentPhotos() {
    return request({
        url: '/student/photo/match',
        method: 'post',
        timeout: 60000  // 匹配操作超时设置为60秒
    })
}
